from selenium import  webdriver
import time
from selenium.webdriver.common.by import By

d = webdriver.Chrome()
d.maximize_window()  #最大化窗口
d.get("https://www.baidu.com")
time.sleep(1)

upload_ele = d.find_element(By.CSS_SELECTOR, '[class="soutu-btn"]')
upload_ele.click()

# 只有 上传的 按钮 是 input 标签的才可以
file_ele = d.find_element(By.CSS_SELECTOR, '[class="upload-pic"]')
file_ele.send_keys(r'C:\Users\Administrator\Desktop\123.png')
time .sleep(10)
d.quit()

